#ifndef JOBS_H
#define JOBS_H

#include "Common.h"

// [*] duplicate job arguments (i.e. ChunkRequestArgs vs ReceivedChunkArgs)

typedef struct {
    string fileName;
    int chunk;
} ChunkRequestArgs; 

typedef struct {
    string fileName;
    int chunk;
} ReceivedChunkArgs; 

typedef struct {
    int clntSocket;
} QueryStatusArgs; 

typedef struct {
    int clntSocket;
    string fileName;
    int chunk;
} ReplyChunkArgs; 

typedef struct {
    string fileName;
    int num_versions;
    int *tag;
    int *revision;
} NewFileArgs; 

typedef struct {
    string fileName;
    int tag;
    int revision;
} FileACKArgs; 

typedef struct {
    string fileName;
    int tag;
    int revision;
} NewVersionArgs;

typedef struct {
    int clntSocket;
} ReplySysInfoArgs;

typedef struct {
    int clntSocket;
    string fileName;
    int tagNumber;
} TransferFileArgs;

typedef struct {
    int clntSocket;
    string fileName;
    int tagNumber;
} TransferUpdateArgs;

// [*] create real constructor that takes in type? and args?
class Job {
public:
    enum JobType { BROADCAST_JOIN, BROADCAST_LEAVE,  REPLYSTATUS, QUERYCHUNK, BROADCAST_RECEIVEDCHUNK,
                   WANTCHUNK, DONTWANTCHUNK, QUERYSTATUS, BROADCAST_NEWFILE, EXITLISTENER, EXITWORKER,
                    REPLYSYSINFO, TRANSFERFILE } ;

    Job();
    ~Job();
  
    JobType type;
    void *args;
};

#endif

